Thank you so much! But no, the mutex is spelled with a small letter. It looks like it's probably different mutex and Mutex.
Anyway, I'm reading about everywhere mutex, see written with examples. And I can't compile fails to collect samples.
Here's an example here mutex - C++ Reference and here std::mutex — cppreference.com for example yet.
I first just wanted to compile this code
Code:
#include <mutex>
void foo()
{
std::mutex m;
}
#include <iostream>
#include <cstdlib>
#include <timertt/all.hpp>
using namespace std;
using namespace std::chrono;
using namespace timertt;
int main()
{
timer_wheel_thread_t tt;
// Timer thread must be started before activation of timers.
// Таймерний потік повинен запускатися перед активацією таймерів.
tt.start();
// The simple single-shot timer.
// простий одноразовий таймер.
tt.activate( milliseconds( 20 ),
[]() { cout << "Simple one-shot" << endl; } );
// The simple periodic timer.
// Will work until timer thread finished.
// простий періодичний таймер.
// Буде працювати, поки закінчиться таймер.
tt.activate( milliseconds( 20 ), milliseconds( 20 ),
[]() {
static int i = 0;
cout << "Simple periodic (" << i << ")" << endl;
++i;
} );
// Allocation of timer and explicit activation.
// озподіл таймера та явної активації.
auto id1 = tt.allocate();
tt.activate( id1, milliseconds( 30 ),
[]() {
cout << "Preallocated single-shot timer" << endl;
} );
// Periodic timer with timer preallocation, explicit activation
// and deactivation from the timer action.
// Періодичний таймер з попереднім розподілом таймера, явна активація
// і деактивація з дії таймера.
auto id2 = tt.allocate();
tt.activate( id2, milliseconds( 40 ), milliseconds( 15 ),
[id2, &tt]() {
static int i = 0;
cout << "Preallicated periodic (" << i << ")" << endl;
++i;
if( i > 2 )
tt.deactivate( id2 );
} );
// Single-shot timer with explicit activation and deactivation
// before timer event.
// одноразовий таймер з явною активацією та деактивізацією
// перед таймером
auto id3 = tt.allocate();
tt.activate( id3, milliseconds( 50 ),
[]() {
cerr << "This timer must not be called!" << endl;
std::abort();
} );
tt.deactivate( id3 );
// Wait for some time.
// Зачекайте деякий час.
this_thread::sleep_for( milliseconds( 200 ) );
// Finish the timer thread.
// Завершити потік таймера.
tt.shutdown_and_join();
}
and got the same error in one of the plug-in files.
Can I still need some heders connect to compile properly, all settings of the compiler seems in order ...
In General, what to do?